def ff5(text):
    num = 1
    num_max = 1
    for i in range(len(text)):
        for k in range(i+1, len(text)):
            if text[k] == text[i]:
                num += 1
                if k == len(text)-1:
                    if num > num_max:
                        num_max = num
                    num = 1
                    break
            else:
                if num > num_max:
                    num_max = num
                num = 1
                break
    print(num_max)
    return num_max


def ff6(text):
    num = 1
    num_max = 1
    i, j = 0, 1
    while j < len(text):
        if text[j] == text[i]:
            num += 1
            j += 1
        else:
            if num > num_max:
                num_max = num
            i = j
            j += 1
            num = 1
    if num > num_max:
        num_max = num
    print(num_max)
    return num_max

def ff8(text):
    max_char = ""
    max_count = 0
    curr_char = ""
    curr_count = 0

    for char in text:
        if char == curr_char:
            curr_count += 1
        else:
            if curr_count > max_count:
                max_count = curr_count
                max_char = curr_char
            curr_count = 1
            curr_char = char

    if curr_count > max_count:
        max_count = curr_count
        max_char = curr_char
    print(max_char, max_count)
    return max_char, max_count